package com.suse.blog.service;

import com.suse.blog.mapper.BlogInfoMapper;
import com.suse.blog.model.BlogInfo;
import com.suse.blog.model.UserInfo;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogService {

    @Autowired
    private BlogInfoMapper blogInfoMapper;

    public List<BlogInfo> getList() {
        return blogInfoMapper.selectAll();
    }

    public BlogInfo getBlogDetail(Integer blogId) {
        return blogInfoMapper.selectById(blogId);
    }

    public Integer insertBlog(BlogInfo blogInfo) {

        return blogInfoMapper.insertBlog(blogInfo);
    }

    public Integer update(BlogInfo blogInfo) {
        return blogInfoMapper.updateBlog(blogInfo);

    }
}
